<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@page import="cn.school.entity.Grade"%>
<%@page import="cn.school.entity.Student"%>
<%@page import="cn.school.service.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%-- <%
request.setCharacterEncoding("utf-8");
int stuno=Integer.parseInt(request.getParameter("stuno"));

Service s=new Service();
Student stu=s.getOne(stuno);

SimpleDateFormat sim =new SimpleDateFormat("yyyy-MM-dd");
String enterdate = sim.format(stu.getEnterdate());
String birthday  = sim.format(stu.getBirthday());
%> --%>
<form action="UpdateStudentServlet" method="post" enctype="multipart/form-data">
	<p>
		学号
		<input type="text" name="stuno" value="${stu.stuno }" readonly="readonly"/>
	</p>
	<p>
		姓名
		<input type="text" name="sname"  value="${stu.sname }" />
	</p>
	<p>
		<label>性别</label>
		 <input type="radio" name="sex" value="男" <c:if test="${stu.sex == '男' }">checked</c:if> />男
			<input type="radio" name="sex" value="女" <c:if test="${stu.sex== '女' }">checked</c:if>/>女 
			<input type="radio" name="sex" value="妖" <c:if test="${stu.sex== '妖' }">checked</c:if> />妖 
			<input type="radio" name="sex" value="人妖"<c:if test="${stu.sex== '人妖' }">checked</c:if> />人妖
	</p>
	<p>
		<label>手机号</label>
		<input type="number" name="telephone" value="${stu.telephone }"/>
	</p>
	<p>
		<label>QQ号</label>
		<input type="number" name="qq" value="${stu.qq }"/>
	</p>
	<p>
		<label>微信</label>
		<input type="text" name="wechat" value="${stu.wechat }"/>
	</p>
	<p>
		<label>年级编号</label>
		<input type="number" name="gradeid" value="${stu.gradeid }"/>
	</p>
	<p>
			<label>年级编号：</label> <select name=gradeid>		
				<c:forEach items="${list }" var="g">
					<c:if test="${g.id == stu.gradeid }">
						<option value=${g.id } selected>${g.gname }</option>
					</c:if>
						<option value=${g.id }> ${g.gname }</option>
				</c:forEach>
			</select>
		</p>
<p>
	<label>入学日期</label>
	<input type="text" name="enterdate" value='<fmt:formatDate value="${stu.enterdate }"/>' />
</p>
<p>
	<label>来自哪里</label>
	<input type="text" name="fromcity" value="${stu.fromcity }" />
</p>
<p>
	<label>出生日期</label>
	<input type="text" name="birthday" value='<fmt:formatDate value="${stu.birthday }"/>' />
</p>
<p>
	<label>地址</label>
	<input type="text" name="address" value="${stu.address }" />
</p>
<p>
	<label>密码</label>
	<input type="number" name="pass" value="${stu.pass }" />
</p>
<p>
	<label>照片</label>
	<input type="file" name="idcardpic" value="${stu.idcardpic }" />
</p>
<input type="submit" value="修改" onclick="return confirm('您确定修改吗？')"/>
</form>
</body>
</html>